<%@ page import="model.Fruit" %>
<%@ page import="java.util.List" %><%--<%@ page import="java.util.List" %>--%>
<%--<%@ page import="model.Fruit" %>--%>
<%--
  Created by IntelliJ IDEA.
  User: 才智
  Date: 2020/11/23
  Time: 0:10
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <link rel="stylesheet" href="node_modules/bootstrap/dist/css/bootstrap.min.css">
    <link rel="stylesheet" href="node_modules/bootstrap/dist/css/bootstrap-grid.min.css">
    <link rel="stylesheet" href="node_modules/bootstrap/dist/css/bootstrap-reboot.min.css">

</head>
<body>
<div class="container-fluid">
    <div class="row">
        <div class="col-md-12">
            <nav class="navbar navbar-expand-lg navbar-light bg-light">

                <button class="navbar-toggler" type="button" data-toggle="collapse"
                        data-target="#bs-example-navbar-collapse-1">
                    <span class="navbar-toggler-icon"></span>
                </button>
                <a class="navbar-brand" href="#">红红火火</a>
                <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
                    <ul class="navbar-nav">
                        <li class="nav-item active">
                            <a class="nav-link" href="#">显示所有水果信息 <span class="sr-only">(current)</span></a>
                        </li>
                        <li class="nav-item">
                            <a class="nav-link" href="fruitAdd.jsp">添加水果信息</a>
                        </li>

                    </ul>
                    <ul class="navbar-nav ml-md-auto">
                        <li class="nav-item active">
                            <a class="nav-link" href="#">水果下架 <span class="sr-only">(current)</span></a>
                        </li>
                    </ul>
                </div>
            </nav>
            <div class="carousel slide" id="carousel-229217">
                <ol class="carousel-indicators">
                    <li data-slide-to="0" data-target="#carousel-229217" class="active">
                    </li>
                    <li data-slide-to="1" data-target="#carousel-229217">
                    </li>
                    <li data-slide-to="2" data-target="#carousel-229217">
                    </li>
                </ol>
                <div class="carousel-inner">
                    <div class="carousel-item active">
                        <img class="d-block w-100" alt="Carousel Bootstrap First"
                             src="https://www.layoutit.com/img/sports-q-c-1600-500-1.jpg"/>
                        <div class="carousel-caption">
                            <h4>
                                First Thumbnail label
                            </h4>
                            <p>
                                Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec id elit non mi porta
                                gravida at eget metus. Nullam id dolor id nibh ultricies vehicula ut id elit.
                            </p>
                        </div>
                    </div>
                    <div class="carousel-item">
                        <img class="d-block w-100" alt="Carousel Bootstrap Second"
                             src="https://www.layoutit.com/img/sports-q-c-1600-500-2.jpg"/>
                        <div class="carousel-caption">
                            <h4>
                                Second Thumbnail label
                            </h4>
                            <p>
                                Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec id elit non mi porta
                                gravida at eget metus. Nullam id dolor id nibh ultricies vehicula ut id elit.
                            </p>
                        </div>
                    </div>
                    <div class="carousel-item">
                        <img class="d-block w-100" alt="Carousel Bootstrap Third"
                             src="https://www.layoutit.com/img/sports-q-c-1600-500-3.jpg"/>
                        <div class="carousel-caption">
                            <h4>
                                Third Thumbnail label
                            </h4>
                            <p>
                                Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec id elit non mi porta
                                gravida at eget metus. Nullam id dolor id nibh ultricies vehicula ut id elit.
                            </p>
                        </div>
                    </div>
                </div>
                <a class="carousel-control-prev" href="#carousel-229217" data-slide="prev"><span
                        class="carousel-control-prev-icon"></span> <span class="sr-only">Previous</span></a> <a
                    class="carousel-control-next" href="#carousel-229217" data-slide="next"><span
                    class="carousel-control-next-icon"></span> <span class="sr-only">Next</span></a>
            </div>

            <table class="table table-sm table-hover table-bordered text-center">
                <thead>
                <tr>
                    <th>
                        Serial
                    </th>
                    <th>
                        name
                    </th>
                    <th>
                        count
                    </th>
                    <th>
                        price
                    </th>
                    <th>
                        remark
                    </th>
                    <th>
                    operation
                    </th>

                </tr>
                </thead>
                <tbody>
                <%
                    List<Fruit> fruits = (List<Fruit>) request.getAttribute("fruits");
                    for (Fruit fruit : fruits
                    ) {
                        out.println("<tr>");
                        out.println("<td>" + fruit.getId() + "</td>");
                        out.println("<td>" + fruit.getName() + "</td>");
                        out.println("<td>" + fruit.getNumber() + "</td>");
                        out.println("<td>" + fruit.getPrice() + "</td>");
                        out.println("<td>" + fruit.getRemark() + "</td>");
                        out.println("<td><a href='fruitDel?id="+fruit.getId()+"'>DELETE</a>&nbsp&nbsp&nbsp&nbsp&nbsp<a href = 'fruitEdit?id="+fruit.getId()+"'>EDIT</a></td>");
                        out.println("</tr>");
                    }
                %>

                </tbody>
            </table>
            <div class="jumbotron">
                <h2>
                    版权所有：别人公司
                </h2>
            </div>
            <div class="row">
                <div class="col-md-12">
                </div>
            </div>
        </div>
    </div>
</div>
<script src="node_modules/bootstrap/dist/js/bootstrap.min.js"></script>
<script src="node_modules/bootstrap/dist/js/bootstrap.bundle.min.js"></script>


</body>
</html>